home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / DesktopAnimation.p < prev    next >
Text File  |  1996-05-01  |  9KB  |  264 lines

  1. {
  2.      File:        DesktopAnimation.p
  3.  
  4.      Contains:    Desktop Animation Interfaces.
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT DesktopAnimation;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DESKTOPANIMATION__}
  28. {$SETC __DESKTOPANIMATION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DesktopAnimationIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __APPEARANCE__}
  35. {$I Appearance.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __CODEFRAGMENTS__}
  38. {$I CodeFragments.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __COLLECTIONS__}
  41. {$I Collections.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __DIALOGS__}
  44. {$I Dialogs.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __DISPLAYS__}
  47. {$I Displays.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __FILEMANAGERTYPES__}
  50. {$I FileManagerTypes.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __GXTYPES__}
  53. {$I GXTypes.p}
  54. {$ENDC}
  55. {$IFC UNDEFINED __QDOFFSCREEN__}
  56. {$I QDOffscreen.p}
  57. {$ENDC}
  58. {$IFC UNDEFINED __TEXTOBJECTS__}
  59. {$I TextObjects.p}
  60. {$ENDC}
  61. {$IFC UNDEFINED __TYPES__}
  62. {$I Types.p}
  63. {$ENDC}
  64.  
  65. {$PUSH}
  66. {$ALIGN MAC68K}
  67. {$LibExport+}
  68.  
  69. {$IFC FOR_SYSTEM8_COOPERATIVE }
  70. {  Gestalt selectors to tell if DAM is installed #### Move to Gestalt.i later  }
  71.  
  72. CONST
  73.     gestaltDesktopAnimationMgr    = 'danm';
  74.     gestaltDesktopAnimationMgrPresent = 0;                        {  If bit set then DAM is present }
  75.  
  76. {  Desktop Animation module file resources  }
  77.     kDesktopAnimModuleFileType    = 'damm';
  78.     kDesktopAnimListRsrcType    = 'giz#';
  79.     kDesktopAnimListRsrcVers    = 0;
  80.     kDesktopAnimListRsrcID        = 128;
  81.     kDesktopAnimFirstRsrcID        = 8192;
  82.     kDesktopAnimLastRsrcID        = 16383;
  83.  
  84. {  Properties relating to the DesktopAnimPanel  }
  85.     kDesktopAnimPanelPropertyTag = 'ptag';
  86.     kDesktopAnimPanelUndoTextTag = 'utxt';
  87.     kDesktopAnimPanelValueToggleTag = 'vtog';
  88.  
  89. {  Desktop Animation info values  }
  90.     kDesktopAnimModuleInfoVers    = 0;
  91.     kDesktopAnimModuleInfoShareAny = 0;
  92.  
  93. {  DesktopAnimFlags  }
  94.     kDesktopAnimDesktop            = $00000001;
  95.     kDesktopAnimBackground        = $00000002;                    {  No drawing behind this module }
  96.     kDesktopAnimScreenSaver        = $00000004;
  97.     kDesktopAnimCanShareWindow    = $00000008;
  98.     kDesktopAnimAllDisplays        = $00000010;
  99.     kDesktopAnimIsSharingWindow    = $00000020;                    {  If called as part of multiple modules }
  100.     kDesktopAnimUnfadeOnKeyboard = $00000040;                    {  ScreenSaver only }
  101.     kDesktopAnimUnfadeOnMouseMotion = $00000080;                {  ScreenSaver only }
  102.     kDesktopAnimOwnsColorPalette = $00000100;                    {  ScreenSaver only }
  103.     kDesktopAnimRequestTerminate = $00000200;                    {  ScreenSaver output only }
  104.     kDesktopAnimDrawingOffscreen = $00000400;                    {  Should be set when asking a module to draw to an offscreen }
  105.                                                                 {  Flags that indicate what mode we are running in }
  106.     kDesktopAnimModeFlags        = $00000007;                    {  Flags we determine at runtime when initializing/running a module }
  107.     kDesktopAnimRuntimeFlags    = $00000737;
  108.  
  109.  
  110. TYPE
  111.     DesktopAnimFlags                    = UInt32;
  112. {  Pre-defined Desktop Animation property tags  }
  113.  
  114. CONST
  115.     kDesktopAnimDisplayRgnTag    = 'drgn';
  116.     kDesktopAnimDisplayDepthTag    = 'dpth';
  117.  
  118. {  Error codes (will be moved to Error.i when we have an assigned range)  }
  119.     kDesktopAnimModuleNotFoundErr = -3000;
  120.     kDesktopAnimServerNotFoundErr = -3001;
  121.     kDesktopAnimDrawNotFoundErr    = -3002;
  122.     kDesktopAnimPanelNotFoundErr = -3003;
  123.     kDesktopAnimDrawInitErr        = -3004;
  124.     kDesktopAnimDrawPanelErr    = -3005;
  125.     kDesktopAnimBadScreenSaverErr = -3006;
  126.     kDesktopAnimScreenSaverInternalErr = -3007;
  127.     kDesktopAnimItemNotModuleErr = -3008;
  128.     kDesktopAnimNoQuickdrawGXErr = -3009;
  129.     kDesktopAnimBadDesktopAnimModuleDescRefErr = -3010;
  130.     kDesktopAnimUnknownModuleListVersErr = -3011;
  131.     kDesktopAnimUnknownModuleInfoVersErr = -3012;
  132.     kDesktopAnimUnknownPatternListVersErr = -3013;
  133.     kDesktopAnimIllegalDesktopAnimationStatusErr = -3014;
  134.     kDesktopAnimModuleNameTooLongErr = -3015;
  135.     kDesktopAnimOffscreenLockPixelsErr = -3016;
  136.     kDesktopAnimQuickdrawGXErr    = -3017;
  137.  
  138. {  Desktop Pattern Support  }
  139.     kDesktopPatternListRsrcType    = 'dtp#';
  140.     kDesktopPatternListRsrcVers    = 0;
  141.     kDesktopPatternListRsrcID    = 128;
  142.  
  143. {  Reasons Screen Saver wants to unfade  }
  144.     kScreenSaverUnfadeUnknown    = 0;
  145.     kScreenSaverUnfadeKeyboard    = 1;
  146.     kScreenSaverUnfadeMouseMotion = 2;
  147.     kScreenSaverUnfadeByRequest    = 3;
  148.     kScreenSaverUnfadeSelfRequest = 4;
  149.  
  150.  
  151. TYPE
  152.     ScreenSaverUnfadeType                = SInt32;
  153. {  The drawing surfaces record  }
  154.     DesktopAnimGraphicsPortsPtr = ^DesktopAnimGraphicsPorts;
  155.     DesktopAnimGraphicsPorts = RECORD
  156.         drawPort:                CGrafPtr;
  157.         gxDrawPort:                gxViewPort;
  158.     END;
  159.  
  160. {  Offscreen drawing record  }
  161.     DesktopAnimOffscreenGraphicsPortsPtr = ^DesktopAnimOffscreenGraphicsPorts;
  162.     DesktopAnimOffscreenGraphicsPorts = RECORD
  163.         offGWorld:                GWorldPtr;
  164.         offGXDrawPort:            gxViewPort;
  165.         offGXViewDevice:        gxViewDevice;
  166.         offGXViewGroup:            gxViewGroup;
  167.     END;
  168.  
  169. {  Info record for modules when created/opened  }
  170.     DesktopAnimModuleInfoPtr = ^DesktopAnimModuleInfo;
  171.     DesktopAnimModuleInfo = RECORD
  172.         version:                SInt32;
  173.         moduleFlags:            DesktopAnimFlags;
  174.         shareWithSignature:        OSType;
  175.     END;
  176.  
  177. {  Info record for Desktop Animation list resource (kDesktopAnimListRsrcType)  }
  178.     DesktopAnimModuleListInfoPtr = ^DesktopAnimModuleListInfo;
  179.     DesktopAnimModuleListInfo = RECORD
  180.         itemListID:                SInt16;
  181.         textObjectListID:        SInt16;
  182.         byLineIndex:            SInt16;
  183.         moduleNameIndex:        SInt16;
  184.         moduleInfo:                DesktopAnimModuleInfo;
  185.         desktopAnimPanelHandler: Str63;
  186.         desktopAnimDrawHandler:    Str63;
  187.     END;
  188.  
  189. {  The Desktop Animation list resource (kDesktopAnimListRsrcType)  }
  190.     DesktopAnimModuleListRsrcRecPtr = ^DesktopAnimModuleListRsrcRec;
  191.     DesktopAnimModuleListRsrcRec = RECORD
  192.         version:                SInt32;
  193.         desktopAnimServerHandler: Str63;
  194.         modulesCnt:                SInt32;
  195.         modules:                ARRAY [0..0] OF DesktopAnimModuleListInfo;
  196.     END;
  197.  
  198.     DesktopAnimModuleListRsrcPtr        = ^DesktopAnimModuleListRsrcRec;
  199.     DesktopAnimModuleListRsrcHandle        = ^DesktopAnimModuleListRsrcPtr;
  200. {  Desktop Pattern Record  }
  201.     DesktopPatternPtr = ^DesktopPattern;
  202.     DesktopPattern = RECORD
  203.         ppatRsrcID:                SInt16;
  204.         nameListID:                SInt16;
  205.         nameListIndex:            SInt16;
  206.     END;
  207.  
  208. {  Desktop Pattern List resource (kDesktopPatternListRsrcType)  }
  209.     DesktopPatternListRsrcRecPtr = ^DesktopPatternListRsrcRec;
  210.     DesktopPatternListRsrcRec = RECORD
  211.         version:                SInt16;
  212.         pattCnt:                SInt16;
  213.         patterns:                ARRAY [0..0] OF DesktopPattern;
  214.     END;
  215.  
  216.     DesktopPatternListRsrcPtr            = ^DesktopPatternListRsrcRec;
  217.     DesktopPatternListRsrcHandle        = ^DesktopPatternListRsrcPtr;
  218. {$ENDC}
  219. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  220. {  Desktop Animation Module type  }
  221.  
  222. CONST
  223.     kItemIsBackground            = $0001;
  224.     kItemIsModule                = $0002;
  225.     kItemIsPattern                = $0003;
  226.     kItemIsNoModule                = $0004;                        {  Used internally }
  227.  
  228.  
  229. TYPE
  230.     DesktopAnimItemType                    = SInt16;
  231. {  Desktop Animation status  }
  232.  
  233. CONST
  234.     kDesktopAnimationTurnedOn    = $00000001;                    {  Desktop animation is on }
  235.     kScreenSaverTurnedOn        = $00000002;                    {  Screen saving is turned on }
  236.     kScreenSaverAsleep            = $00000004;                    {  Currently in screen saving mode }
  237.     kScreenSaverDemoMode        = $00000008;                    {  Screen saving demo mode (read only) }
  238.  
  239.  
  240. TYPE
  241.     DesktopAnimationStatusType            = UInt32;
  242. {  Module description reference  }
  243.     DesktopAnimModuleDescRef = ^LONGINT;
  244. {  Desktop Animation Manager API  }
  245. FUNCTION GetDesktopAnimationDesktopPatternsFileRef(VAR pattFileRef: FSObjectRef): OSStatus; C;
  246. PROCEDURE GetDesktopAnimationStatus(VAR status: DesktopAnimationStatusType); C;
  247. FUNCTION SetDesktopAnimationStatus(status: DesktopAnimationStatusType): OSStatus; C;
  248. FUNCTION NewDesktopAnimationModuleDescRef(itemName: TextObject; itemFile: FSObjectRef; itemID: SInt32; itemType: DesktopAnimItemType; VAR moduleDescRef: DesktopAnimModuleDescRef): OSStatus; C;
  249. FUNCTION CloneDesktopAnimationModuleDescRef(moduleDescRef: DesktopAnimModuleDescRef): OSStatus; C;
  250. FUNCTION EquivalentDesktopAnimationModuleDescRefs(moduleADescRef: DesktopAnimModuleDescRef; moduleBDescRef: DesktopAnimModuleDescRef): BOOLEAN; C;
  251. FUNCTION GetDesktopAnimationModuleDescInfo(moduleDescRef: DesktopAnimModuleDescRef; itemName: TextObject; VAR itemFile: FSObjectRef; VAR itemID: SInt32; VAR itemType: DesktopAnimItemType): OSStatus; C;
  252. FUNCTION DisposeDesktopAnimModuleDescRef(moduleDescRef: DesktopAnimModuleDescRef): OSStatus; C;
  253. {$ENDC}
  254. {$ALIGN RESET}
  255. {$POP}
  256.  
  257. {$SETC UsingIncludes := DesktopAnimationIncludes}
  258.  
  259. {$ENDC} {__DESKTOPANIMATION__}
  260.  
  261. {$IFC NOT UsingIncludes}
  262.  END.
  263. {$ENDC}
  264.